home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
bbs
/
cddk9606.zip
/
HEADERS.ARJ
/
DMENUS.INT
< prev
next >
Wrap
Text File
|
1996-06-14
|
4KB
|
98 lines
{ ───────────────────────────────────────────────────────────────────────── }
{ DMENUS: A script-based menu system for door games }
{ Copyright 1996 David Pinch ∙ All Rights Reserved Worldwide }
{ ───────────────────────────────────────────────────────────────────────── }
UNIT DMenus;
{$B-} { . . . . . . . . . . . . . . . . . . . . Shortcut boolean evaluation }
{$F+} { . . . . . . . . . . . . . . . . . . . . Force far calls for safety }
{$I-} { . . . . . . . . . . . . . . . . . . . Disable input/output checking }
{$O+} { . . . . . . . . . . . . . . . . . . Allow this unit to be overlayed }
{$Q-} { . . . . . . . . . . . . . . Do not generate overflow-checking code }
{$R-} { . . . . . . . . . . . . . . . . Do not generate range-checking code }
{$S-} { . . . . . . . . . . . . . . . . Do not generate stack-checking code }
{$X+} { . . . . . . . . . . . Extended syntax for pChars and function calls }
INTERFACE
USES
Objects, Scripts;
TYPE
tMenuItem = OBJECT(tObject)
Id : Byte; { . . . . . . . . . . . . Return code }
Bar : pChar; { . . . . Text shown in the lightbar }
Exec : pChar; { . . . . . . . . . Optional commands }
Key : pChar; { . . . . . . . . . . . . . . Hotkey }
Text : pChar; { . . . . . . . . . . . . . Help text }
CONSTRUCTOR Init(i:Byte; b,e,k,t:pChar);
DESTRUCTOR Done; VIRTUAL;
END;
pMenuItem = ^tMenuItem;
tMenu = OBJECT(tID)
Columns : Byte; { . Number of columns of the internal display }
Current : Byte; { . . . . . . . . Current item in the lightbar }
Draw : pChar; { . . . . . . . . . . . . . . . Drawing script }
FileName : pChar; { . . . . . . . . . . . . Location of MNU file }
Format : pChar; { . . . . . . . Format of the internal display }
Internal : Boolean; { . . . . . . . . . . . . Draw internal menu? }
Items : pCollection; { . . . . . . . . . . Collection of menu items }
LightBar : Boolean; { . . . . . . . Use the lightbar entry method? }
Pressed : Char; { . . . . . . . . . . . Last character pressed }
Prompt : pChar; { . . . Prompt shown on the bottom of the menu }
StartAt : Byte; { . . . . Starting point of the lightbar menu }
CONSTRUCTOR Init(Name,Path:pChar);
PROCEDURE AddItem(i:Byte; b,c,k,t:pChar);
PROCEDURE Defaults; { . . . . . Assigns default values }
PROCEDURE DrawMenu; { . . . . . . . . . Draws the menu }
PROCEDURE DrawPrompt; { . . . . . Draws the menu prompt }
PROCEDURE Load; { . . . . . . . Loads an MNU file }
FUNCTION Run:Byte; { . . . . . . . Executes the menu }
PROCEDURE ShiftLightBar(n:ShortInt); { . . . . . . Shifts the lightbar }
PROCEDURE Update(b,e,k,t:pChar); { . . . . . Updates the last item }
FUNCTION Valid:Boolean; { . Returns validity of keystroke }
DESTRUCTOR Done; VIRTUAL;
END;
pMenu = ^tMenu;
{#Start}
PROCEDURE RegisterMenu(Name,PathName:pChar);
{
PURPOSE : Registers a menu with the system.
PARAMS : Name A keyword to identify the menu in the future.
You must use a unique identifier.
PathName The name of the menu configuration script, or
INTERNAL (not case-sensitive). The script
is immediately processed if a valid path is
specified; otherwise, it is assumed that you
will create the menu internally.
}
FUNCTION RunMenu(Name:pChar):Byte;
{
PURPOSE : Executes a previously loaded menu.
}
IMPLEMENTATION
{ The source code is available upon registration. }
END.